package com.example.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.example.test.R;
import com.sevenheaven.segmentcontrol.SegmentControl;

public class Write extends AppCompatActivity implements View.OnClickListener {

    public static final String TAG ="Write";
    private SegmentControl mSegmentControl;
    private TextView write_tv_rutuen;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_write);
        write_tv_rutuen=findViewById(R.id.write_tv_rutuen);
        write_tv_rutuen.setOnClickListener(this);
        mSegmentControl = (SegmentControl) findViewById(R.id.segment_control);
        mSegmentControl.setOnSegmentControlClickListener(new SegmentControl.OnSegmentControlClickListener() {
            @Override
            public void onSegmentControlClick(int index) {
                Log.i(TAG, "onSegmentControlClick: index = " + index);
            }
        });
    }

    @Override
    public void onClick(View v) {
        Intent in=new Intent(getApplicationContext(),Main.class);
        startActivity(in);
    }
}
